﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Gmis.Public;

namespace Gmis.Web.UI
{
    //看新闻明细 根据type 的不同区不同的表  type为空 去news数据 其他取newsfile数据
    public partial class NewsDetail : System.Web.UI.Page
    {

        public string sTitle = "";
        public string dDate = "";
        public string sContent = "";

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack) return;
            string sId = CommonFunction.getRequestValue("sId");
            string sType = CommonFunction.getRequestValue("type");
            if (sType == "")
            {
                BLL.News bll = new BLL.News();
                Model.News model = bll.GetModel(sId);
                if (model != null)
                {
                    sTitle = model.sTitle;
                    dDate = model.dDate.ToString("yyyy-MM-dd");
                    sContent = model.sContent;
                }
            }
            else
            {
                BLL.NewsFile bll = new BLL.NewsFile();
                Model.NewsFile model = bll.GetModel(sId);
                if (model != null)
                {
                    sTitle = model.sTitle;
                    dDate = model.dDate.ToString("yyyy-MM-dd");
                    sContent = model.sDescription;
                }
            }

        }
    }
}